<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>材料签收详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css">
    <style>
        .details ul li {width: 50%;float: left;}
        .layui-table thead th{text-align: left;}
        thead tr th:before {content: "● "; color: #e3e3e3; font-size: 12px;}
        .layui-table td{text-indent: 1rem; font-size: 12px; color: #333;}
        .detailed{background-color: #FFF; font-size: 12px; color: #333333; padding: 15px 20px; line-height: 24px;margin-top: 15px;}
        /*.details ul,li{list-style: inherit;}*/
        .detailed p:after {
            content: "\0020";
            display: block;
            height: 0;
            clear: both;
        }
        .detailed p:before {content: "● "; color: #e3e3e3; font-size: 12px; margin-right: 5px; float: left;}
        .detailed .detaL{width: 120px;display: inline-block; float: left;    padding-right: 20px;}
        .detailed .dataR{display: inline-block;float: left;}
        .detailed p{margin-bottom: 10px;}
        .detailedfoot{margin-bottom: 50px;}
        .detailedfoot ul li {width: 50%;float: left;}
        .layui-table thead th{text-align: center;}
        thead tr th:before {content: ""; }
        .layui-table td{text-indent: 0; font-size: 12px; color: #333;}
        .details{padding-bottom: 0;}
        @media screen and (max-width: 750px) {
            .details ul{margin-top: 0;}
            .details ul li{width: 100%;}
            .detailedfoot{width: 100%;overflow-x: auto; padding-left: 0;padding-right: 0;}
            .detailedfoot table{width: 200%!important;}
            .engineering{margin-top: 50px;}

        }
        table tr th{text-align: center!important;}
        table tr td{text-align: center!important;}

    </style>
</head>
<body>
<div class="_PC">
    <form class="layui-form layui-form-pane" action="" >
        <button class="layui-btn" type="button" onclick="history.back(-1);"><i class="layui-icon"></i></button>

        <div class="engineering"><!--工程信息-->
            <div class="titles">郑州建材有限公司</div>
            <div class="details">
                <!--<ul>-->
                    <!--<li><span class="detaL">工程名称：</span><span class="dataR">  湖北路 </span></li>-->
                    <!--<li><span class="detaL">供货单创建时间：</span><span class="dataR">2017-11-22 18:14:26</span></li>-->
                    <!--<li><span class="detaL">起止点：</span><span class="dataR"> 百花路-白葫芦</span></li>-->
                    <!--<li><span class="detaL">供货单单号：</span><span class="dataR">  2017-12-02 00:00:00 </span></li>-->
                    <!--<li><span class="detaL">收货地址：</span><span class="dataR">0014</span></li>-->
                    <!--<li><span class="detaL">施工单位：</span><span class="dataR"> 李四</span></li>-->
                    <!--<li><span class="detaL">供货商：</span><span class="dataR">张三</span></li>-->
                <!--</ul>-->
            </div>
            <div class="detailedfoot">
                <table class="table layui-table">
                    <tr><th>供货单号</th><th>材料名称</th><th>材料规格</th><th>材料单位</th><th>签收时间</th><th>审核状态</th><th>审核意见</th><th>送料数</th><th>签收数量</th><th>签收人</th></tr></table>
            </div>
        </div>



    </form>
</div>

<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date1'      //开始时间
        });
        laydate.render({
            elem: '#date2'  //结束时间
        });
        var M_data=sessionStorage.data_material;
        M_data=JSON.parse(M_data);                                      //JSON字符串转对象
        var Mdata=M_data.data;
        $('.titles').text(Mdata.compName);
        $('.details').append(' <ul>\n' +
            '                    <li><span class="detaL">项目名称：</span><span class="dataR"> '+Mdata.eppName+'('+Mdata.eppStaEnd+')'+' </span></li>\n' +
            '                    <li><span class="detaL">起止点：</span><span class="dataR">'+Mdata.eppStaEnd+'</span></li>\n' +
            '                    <li><span class="detaL">供货单单号：</span><span class="dataR">'+Mdata.rm_Code+'</span></li>\n' +
            '                    <li><span class="detaL">收货地址：</span><span class="dataR">'+Mdata.r_adr+'</span></li>\n' +
            '                    <li><span class="detaL">施工单位：</span><span class="dataR">'+Mdata.supName+'</span></li>\n' +
            '                    <li><span class="detaL">供货商：</span><span class="dataR">'+Mdata.supName+'</span></li>\n' +
            '                </ul>')

        ajaxs('/api/ctteam/matSignDetails.do','post',{'rm_code':sessionStorage.ccuid,'p':getCookie('yanzheng')},function (data) {
            //console.log(data)
            var datas=data.data;
            datas[0].recvName_Opinion?datas[0].recvName_Opinion=datas[0].recvName_Opinion:datas[0].recvName_Opinion='';
            $('.details ul').append(' <li><span class="detaL">签收意见：</span><span class="dataR">'+datas[0].recvName_Opinion+'</span></li>')

            for(var i=0;i<data.data.length;i++){
                if(!datas[i].hasOwnProperty("rm_Num")){
                    datas[i].rm_Num='暂未签收';
                }
                switch (datas[i].validate){
                    case 0:
                        datas[i].validate='审核通过';
                        break;
                    case -1:
                        datas[i].validate='等待审核';
                        break;
                    case 1:
                        datas[i].validate='审核不通过';
                        break;

                }



                $('.table').append('<tr><td class="_NUMSR">'+datas[i].rm_Code+'</td><td>'+datas[i].mat_Name+'</td><td class="_NUMSR">'+datas[i].mat_Spec+'</td><td>'+datas[i].mat_Bit+'</td><td class="_NUMSR">'+datas[i].rm_Time+'</td><td class="_NUMSR">'+datas[i].validate+'</td><td class="_NUMSR">'+datas[i].reMarks+'</td><td class="_NUMSR">'+datas[i].send_Num+'</td><td class="_NUMSR">'+datas[i].rm_Num+'</td><td class="_NUMSR">'+datas[i].recvName+'</td>></tr>');
                $('.detailedfoot tbody tr td').each(function () {
                    var s = $(this).text();
                    if( s == "undefined" ){
                        $(this).text('');
                    }
                })
            }
                   
		
    })

    })

</script>
</body>
</html>